* Appendix Table D4: BASELINE STOVE OWNERSHIP DOES NOT PREDICT PURCHASE

use "${output}panel_r0_r1_r2.dta", clear // Load merged analysis panel

********************************************************************************

* Keep households surveyed in each round
keep if sample_household == 1

********************************************************************************

* REGRESSIONS

// Reposition baseline value of household controls
foreach var of varlist household_size children_under_five improved_stove_own {
	gen b_`var' = `var' if surveyround == 0
	bys hh_id (surveyround) : replace b_`var' = b_`var'[1] if mi(b_`var')
	}

// Analyses

keep if surveyround == 1

local model_1 "purchased_intervention_stove i.treatment##i.b_improved_stove_own, absorb(districtcode) vce(cluster uniquegrp) nocons"
local model_2 "purchased_intervention_stove i.treatment##i.chirag_strata##i.b_improved_stove_own, absorb(districtcode) vce(cluster uniquegrp) nocons"

estimates clear
forval i = 1/2 {

	// Estimation
	reghdfe `model_`i''
	estimates store model_`i'

	// Outcome mean
	qui sum purchased_intervention_stove if treatment == 0
	qui estadd scalar control_mean = `r(mean)'
	
}

********************************************************************************

* TABLE: EXPORT

estout * ///
	using "${results}/apptable_baseline_improved_predict_purchase.tex", replace style(tex) ///
	cells("b(fmt(a2) star)" se(par fmt(a2))) ///
	noomitted ///
	nobaselevels ///
	stats(control_mean N r2_a, fmt(%15.0gc a2) labels("Control mean" "\(N\)" "Adjusted \(R^2\)")) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) ///
    collabels(none) mlabel(none) ///
	varlabels(1.treatment "\({TREATMENT}_j\)" ///
			1.chirag_strata "\({NGO}_j\)" ///
			1.treatment#1.chirag_strata "\({TREATMENT}_j \times {NGO}_j\)" ///
			1.b_improved_stove_own "\(\mathbbm{1}\left( \text{Owned ICS at baseline} \right)\)" ///
			1.treatment#1.b_improved_stove_own "\({TREATMENT}_j \times \mathbbm{1}\left( \text{Owned ICS at baseline} \right)\)" ///
			1.chirag_strata#1.b_improved_stove_own "\({NGO}_j \times \mathbbm{1}\left( \text{Owned ICS at baseline} \right)\)" ///
			1.treatment#1.chirag_strata#1.b_improved_stove_own "\({TREATMENT}_j \times {NGO}_j \times \mathbbm{1}\left( \text{Owned ICS at baseline} \right)\)" ///
				, elist(1.treatment " \addlinespace" ///
						1.chirag_strata " \addlinespace" ///
						1.treatment#1.chirag_strata " \addlinespace" ///
						1.b_improved_stove_own " \addlinespace" ///
						1.treatment#1.b_improved_stove_own " \addlinespace" ///
						1.chirag_strata#1.b_improved_stove_own " \addlinespace" ///
						1.treatment#1.chirag_strata#1.b_improved_stove_own " \addlinespace") ///
				) ///
	prehead(  ///
		"\begin{table}[h]" ///
		"\centering" ///
		"\caption{Baseline ownership of ICS does not predict purchase of intervention ICS \label{app:tab_baseline_improved_predict_purchase}}" ///
		"\begin{adjustbox}{max width=\textwidth}" ///
		"\begin{threeparttable}" ///
		"\begin{tabular}{lcc}" ///
		"\toprule" ///
        "& (1) & (2) \\ \cmidrule(lr){2-3}" ///
        "& \multicolumn{2}{c}{$\mathbbm{1} \left( \text{Purchased intervention ICS} \right)$} \\ \midrule" /// 
		)  ///
	prefoot("\midrule") ///
	postfoot("District fixed-effects & Yes & Yes \\" ///
			"\bottomrule" ///
			"\end{tabular}" ///
			"\begin{tablenotes}" ///
			"{\setlength\labelsep{0pt}" ///
			"\footnotesize" ///
			"\item \textit{Notes}. The outcome variable is an indicator that equals 1 if household \(i\) in hamlet \(j\) purchased at least one of the two ICS promoted during the intervention. Column (1) presents aggregated results; results are disaggregated by NGO and non-NGO villages in column (2). Standard errors (in parentheses) are clustered at the hamlet level. \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\).}" ///
			"\end{tablenotes}" ///
			"\end{threeparttable}" ///
			"\end{adjustbox}" ///
			"\end{table}" ///
			)

********************************************************************************

* END
